package com.zh.boottinymybatisplus.controller;


import com.zh.boottinymybatisplus.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhanghuan
 * @since 2022-10-23
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @ResponseBody
    @GetMapping("/list")
    public Map<String, Object> getUserList() {
        Map<String, Object> map = new HashMap<>();

        map.put("data", userService.getUserList());
        map.put("code", 1);
        return map;

    }

}
